home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-05-01 | 23.8 KB | 594 lines | [ TEXT/MPS ]
{ File: AEDataModel.p Contains: AppleEvent Data Model Interfaces. Version: Technology: Copland Release: Universal Interfaces 3.0d3 on Copland DR1 Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved. Bugs?: If you find a problem with this file, send the file and version information (from above) and the problem description to: Internet: apple.bugs@applelink.apple.com AppleLink: APPLE.BUGS } {$IFC UNDEFINED UsingIncludes} {$SETC UsingIncludes := 0} {$ENDC} {$IFC NOT UsingIncludes} UNIT AEDataModel; INTERFACE {$ENDC} {$IFC UNDEFINED __AEDATAMODEL__} {$SETC __AEDATAMODEL__ := 1} {$I+} {$SETC AEDataModelIncludes := UsingIncludes} {$SETC UsingIncludes := 1} {$IFC UNDEFINED __TYPES__} {$I Types.p} {$ENDC} {$IFC UNDEFINED __MEMORY__} {$I Memory.p} {$ENDC} {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED } {$IFC NOT FOR_PTR_BASED_AE } {$IFC UNDEFINED __MIXEDMODE__} {$I MixedMode.p} {$ENDC} {$ENDC} {$ENDC} {$IFC FOR_SYSTEM8_PREEMPTIVE } {$IFC UNDEFINED __MEMALLOCATORS__} {$I MemAllocators.p} {$ENDC} {$ENDC} {$PUSH} {$ALIGN MAC68K} {$LibExport+} CONST { Apple event descriptor types } typeBoolean = 'bool'; typeChar = 'TEXT'; { Preferred numeric Apple event descriptor types } typeSInt16 = 'shor'; typeSInt32 = 'long'; typeUInt32 = 'magn'; typeSInt64 = 'comp'; typeIEEE32BitFloatingPoint = 'sing'; typeIEEE64BitFloatingPoint = 'doub'; type128BitFloatingPoint = 'ldbl'; typeDecimalStruct = 'decm'; { Non-preferred Apple event descriptor types } typeSMInt = 'shor'; typeShortInteger = 'shor'; typeInteger = 'long'; typeLongInteger = 'long'; typeMagnitude = 'magn'; typeComp = 'comp'; typeSMFloat = 'sing'; typeShortFloat = 'sing'; typeFloat = 'doub'; typeLongFloat = 'doub'; typeExtended = 'exte'; { More Apple event descriptor types } typeAEList = 'list'; typeAERecord = 'reco'; typeAppleEvent = 'aevt'; typeEventRecord = 'evrc'; typeTrue = 'true'; typeFalse = 'fals'; typeAlias = 'alis'; typeEnumerated = 'enum'; typeType = 'type'; typeAppParameters = 'appa'; typeProperty = 'prop'; typeFSS = 'fss '; typeKeyword = 'keyw'; typeSectionH = 'sect'; typeWildCard = '****'; typeApplSignature = 'sign'; typeQDRectangle = 'qdrt'; typeFixed = 'fixd'; typeSessionID = 'ssid'; typeTargetID = 'targ'; typeProcessSerialNumber = 'psn '; typeKernelProcessID = 'kpid'; typeDispatcherID = 'dspt'; typeNull = 'null'; { null or nonexistent data } { Keywords for Apple event attributes } keyTransactionIDAttr = 'tran'; keyReturnIDAttr = 'rtid'; keyEventClassAttr = 'evcl'; keyEventIDAttr = 'evid'; keyAddressAttr = 'addr'; keyOptionalKeywordAttr = 'optk'; keyTimeoutAttr = 'timo'; keyInteractLevelAttr = 'inte'; { this attribute is read only - will be set in AESend } keyEventSourceAttr = 'esrc'; { this attribute is read only } keyMissedKeywordAttr = 'miss'; { this attribute is read only } keyOriginalAddressAttr = 'from'; { new in 1.0.1 } { Constants used for specifying the factoring of AEDescLists. } kAEDescListFactorNone = 0; kAEDescListFactorType = 4; kAEDescListFactorTypeAndSize = 8; { Constants used creating an AppleEvent } { Constant for the returnID param of AECreateAppleEvent } kAutoGenerateReturnID = -1; { AECreateAppleEvent will generate a session-unique ID } { Constant for transaction ID’s } kAnyTransactionID = 0; { no transaction is in use } { Apple event manager data types } TYPE DescType = ResType; AEKeyword = FourCharCode; {$IFC FOR_PTR_BASED_AE } AEDescData = ^LONGINT; AEDescPtr = ^AEDesc; AEDesc = RECORD descriptorType: DescType; descriptorData: AEDescData; END; { typedef AEDesc * AEDescPtr; } {$ELSEC} AEDesc = RECORD descriptorType: DescType; dataHandle: Handle; END; AEDescPtr = ^AEDesc; {$ENDC} AEKeyDescPtr = ^AEKeyDesc; AEKeyDesc = RECORD descKey: AEKeyword; descContent: AEDesc; END; { a list of AEDesc's is a special kind of AEDesc } AEDescList = AEDesc; AEDescListPtr = ^AEDescList; { AERecord is a list of keyworded AEDesc's } AERecord = AEDescList; AERecordPtr = ^AERecord; { an AEDesc which contains address data } AEAddressDesc = AEDesc; AEAddressDescPtr = ^AEAddressDesc; { an AERecord that contains an AppleEvent, and related data types } AppleEvent = AERecord; AppleEventPtr = ^AppleEvent; AEReturnID = SInt16; AETransactionID = SInt32; AEEventClass = FourCharCode; AEEventID = FourCharCode; AEArrayType = SInt8; CONST kAEDataArray = 0; kAEPackedArray = 1; kAEDescArray = 3; kAEKeyDescArray = 4; {$IFC FOR_PTR_BASED_AE } TYPE AEArrayDataPtr = ^AEArrayData; AEArrayData = RECORD CASE INTEGER OF 0: ( kAEDataArray: ARRAY [0..0] OF INTEGER; ); 1: ( kAEPackedArray: SInt8; ); 2: ( kAEDescArray: ARRAY [0..0] OF AEDesc; ); 3: ( kAEKeyDescArray: ARRAY [0..0] OF AEKeyDesc; ); END; {$ELSEC} kAEHandleArray = 2; TYPE AEArrayData = RECORD CASE INTEGER OF 0: ( kAEDataArray: ARRAY [0..0] OF INTEGER; ); 1: ( kAEPackedArray: SInt8; ); 2: ( kAEHandleArray: ARRAY [0..0] OF Handle; ); 3: ( kAEDescArray: ARRAY [0..0] OF AEDesc; ); 4: ( kAEKeyDescArray: ARRAY [0..0] OF AEKeyDesc; ); END; {$ENDC} AEArrayDataPointer = ^AEArrayData; AEArrayDataPointerPtr = ^AEArrayDataPointer; { ************************************************************************* These calls are used to set up and modify the coercion dispatch table. ************************************************************************* } {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED } {$IFC NOT FOR_PTR_BASED_AE } AECoerceDescProcPtr = ProcPtr; { FUNCTION AECoerceDesc((CONST)VAR fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc): OSErr; } AECoercePtrProcPtr = ProcPtr; { FUNCTION AECoercePtr(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc): OSErr; } AECoerceDescUPP = UniversalProcPtr; AECoercePtrUPP = UniversalProcPtr; CONST uppAECoerceDescProcInfo = $00003FE0; uppAECoercePtrProcInfo = $0003FFE0; FUNCTION NewAECoerceDescProc(userRoutine: AECoerceDescProcPtr): AECoerceDescUPP; {$IFC NOT GENERATINGCFM } INLINE $2E9F; {$ENDC} FUNCTION NewAECoercePtrProc(userRoutine: AECoercePtrProcPtr): AECoercePtrUPP; {$IFC NOT GENERATINGCFM } INLINE $2E9F; {$ENDC} FUNCTION CallAECoerceDescProc({CONST}VAR fromDesc: AEDesc; toType: DescType; handlerRefcon: LONGINT; VAR toDesc: AEDesc; userRoutine: AECoerceDescUPP): OSErr; {$IFC NOT GENERATINGCFM} INLINE $205F, $4E90; {$ENDC} FUNCTION CallAECoercePtrProc(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; handlerRefcon: LONGINT; VAR result: AEDesc; userRoutine: AECoercePtrUPP): OSErr; {$IFC NOT GENERATINGCFM} INLINE $205F, $4E90; {$ENDC} TYPE AECoercionHandlerUPP = UniversalProcPtr; FUNCTION AEInstallCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; handlerRefcon: LONGINT; fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0A22, $A816; {$ENDC} FUNCTION AERemoveCoercionHandler(fromType: DescType; toType: DescType; handler: AECoercionHandlerUPP; isSysHandler: BOOLEAN): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0723, $A816; {$ENDC} FUNCTION AEGetCoercionHandler(fromType: DescType; toType: DescType; VAR handler: AECoercionHandlerUPP; VAR handlerRefcon: LONGINT; VAR fromTypeIsDesc: BOOLEAN; isSysHandler: BOOLEAN): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0B24, $A816; {$ENDC} {$ENDC} {$ENDC} {$IFC FOR_SYSTEM8_PREEMPTIVE } {$IFC FOR_PTR_BASED_AE } TYPE AECoercionProc = ProcPtr; { FUNCTION AECoercionProc(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: ByteCount; toType: DescType; handlerRefcon: UNIV Ptr; VAR result: AEDesc): OSStatus; C; } FUNCTION AEInstallCoercion(fromType: DescType; toType: DescType; handler: AECoercionProc; handlerRefcon: UNIV Ptr): OSStatus; C; FUNCTION AERemoveCoercion(fromType: DescType; toType: DescType; handler: AECoercionProc): OSStatus; C; FUNCTION AEGetCoercion(fromType: DescType; toType: DescType; VAR handler: AECoercionProc; VAR handlerRefcon: UNIV Ptr): OSStatus; C; {$ENDC} {$ENDC} { ************************************************************************* The following calls provide for a coercion interface. ************************************************************************* } {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE } FUNCTION AECoercePtr(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; toType: DescType; VAR result: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0A02, $A816; {$ENDC} FUNCTION AECoerceDesc({CONST}VAR theAEDesc: AEDesc; toType: DescType; VAR result: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0603, $A816; {$ENDC} {$ENDC} { ************************************************************************* The following calls apply to any AEDesc. Every 'result' descriptor is created for you, so you will be responsible for memory management (including disposing) of the descriptors so created. ************************************************************************* } {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE } FUNCTION AECreateDesc(typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size; VAR result: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0825, $A816; {$ENDC} FUNCTION AEDisposeDesc(VAR theAEDesc: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0204, $A816; {$ENDC} FUNCTION AEDuplicateDesc({CONST}VAR theAEDesc: AEDesc; VAR result: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0405, $A816; {$ENDC} {$ENDC} {$IFC FOR_SYSTEM8_PREEMPTIVE } {$IFC FOR_PTR_BASED_AE } FUNCTION AEClearDesc(VAR descToClear: AEDesc): OSStatus; C; FUNCTION AEDescIsNull({CONST}VAR desc: AEDesc): BOOLEAN; C; FUNCTION AESizeOfDescData({CONST}VAR desc: AEDesc; VAR descriptorType: DescType; VAR dataSize: ByteCount): OSStatus; C; FUNCTION AEGetDescData({CONST}VAR desc: AEDesc; VAR typeCode: DescType; dataBuffer: UNIV Ptr; maximumSize: ByteCount; VAR actualSize: ByteCount): OSStatus; C; {$ENDC} {$ENDC} { ************************************************************************* The following calls apply to AEDescList. Since AEDescList is a subtype of AEDesc, the calls in the previous section can also be used for AEDescList. All list and array indices are 1-based. If the data was greater than maximumSize in the routines below, then actualSize will be greater than maximumSize, but only maximumSize bytes will actually be retrieved. ************************************************************************* } {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE } FUNCTION AECreateList(factoringPtr: UNIV Ptr; factoredSize: Size; isRecord: BOOLEAN; VAR resultList: AEDescList): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0706, $A816; {$ENDC} FUNCTION AECountItems({CONST}VAR theAEDescList: AEDescList; VAR theCount: LONGINT): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0407, $A816; {$ENDC} FUNCTION AEPutPtr(VAR theAEDescList: AEDescList; index: LONGINT; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0A08, $A816; {$ENDC} FUNCTION AEPutDesc(VAR theAEDescList: AEDescList; index: LONGINT; {CONST}VAR theAEDesc: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0609, $A816; {$ENDC} FUNCTION AEGetNthPtr({CONST}VAR theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $100A, $A816; {$ENDC} FUNCTION AEGetNthDesc({CONST}VAR theAEDescList: AEDescList; index: LONGINT; desiredType: DescType; VAR theAEKeyword: AEKeyword; VAR result: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0A0B, $A816; {$ENDC} FUNCTION AESizeOfNthItem({CONST}VAR theAEDescList: AEDescList; index: LONGINT; VAR typeCode: DescType; VAR dataSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $082A, $A816; {$ENDC} FUNCTION AEGetArray({CONST}VAR theAEDescList: AEDescList; arrayType: AEArrayType; arrayPtr: AEArrayDataPointer; maximumSize: Size; VAR itemType: DescType; VAR itemSize: Size; VAR itemCount: LONGINT): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0D0C, $A816; {$ENDC} FUNCTION AEPutArray(VAR theAEDescList: AEDescList; arrayType: AEArrayType; {CONST}VAR arrayPtr: AEArrayData; itemType: DescType; itemSize: Size; itemCount: LONGINT): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0B0D, $A816; {$ENDC} FUNCTION AEDeleteItem(VAR theAEDescList: AEDescList; index: LONGINT): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $040E, $A816; {$ENDC} {$ENDC} { ************************************************************************* The following calls apply to AERecord. Since AERecord is a subtype of AEDescList, the calls in the previous sections can also be used for AERecord an AERecord can be created by using AECreateList with isRecord set to true. ************************************************************************* } { Note: none of the “key” calls were available in the PowerPC 7.x IntefaceLib. In C, a #define is used to map “key” calls to “param” calls. In pascal this mapping is done in externally linked glue code. } {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE } FUNCTION AEPutKeyPtr(VAR theAERecord: AERecord; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0A0F, $A816; {$ENDC} FUNCTION AEPutKeyDesc(VAR theAERecord: AERecord; theAEKeyword: AEKeyword; {CONST}VAR theAEDesc: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0610, $A816; {$ENDC} FUNCTION AEGetKeyPtr({CONST}VAR theAERecord: AERecord; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0E11, $A816; {$ENDC} FUNCTION AEGetKeyDesc({CONST}VAR theAERecord: AERecord; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0812, $A816; {$ENDC} FUNCTION AESizeOfKeyDesc({CONST}VAR theAERecord: AERecord; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0829, $A816; {$ENDC} FUNCTION AEDeleteKeyDesc(VAR theAERecord: AERecord; theAEKeyword: AEKeyword): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0413, $A816; {$ENDC} {$ENDC} {$IFC FOR_SYSTEM7_ONLY } { Note: The following #defines map “key” calls on AERecords into “param” calls on AppleEvents. Although no errors are currently returned if AERecords are passed to “param” calls and AppleEvents to “key” calls, the behavior of this type of API-mixing is not explicitly documented in Inside Macintosh. It just happens that the “key” calls have the same functionality as their “param” counterparts. Since none of the “key” calls are currently available in the PowerPC IntefaceLib, the #defines exploit the fact that “key” and “param” routines can be used interchangeably, and makes sure that every invokation of a “key” API becomes an invokation of a “param” API. } {$ENDC} { ************************************************************************* The following calls create and manipulate the AppleEvent data type. ************************************************************************* } {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE } FUNCTION AECreateAppleEvent(theAEEventClass: AEEventClass; theAEEventID: AEEventID; {CONST}VAR target: AEAddressDesc; returnID: AEReturnID; transactionID: AETransactionID; VAR result: AppleEvent): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0B14, $A816; {$ENDC} {$ENDC} {$IFC FOR_SYSTEM8_PREEMPTIVE } {$IFC FOR_PTR_BASED_AE } FUNCTION AECustomCreateAppleEvent(theAEEventClass: AEEventClass; theAEEventID: AEEventID; {CONST}VAR target: AEAddressDesc; returnID: AEReturnID; transactionID: AETransactionID; allocator: MemAllocatorRef; VAR result: AppleEvent): OSStatus; C; FUNCTION AECreateReplyAppleEvent({CONST}VAR replyAddress: AEAddressDesc; allocator: MemAllocatorRef; VAR result: AppleEvent): OSStatus; C; {$ENDC} {$ENDC} { ************************************************************************* The following calls are used to pack and unpack parameters from records of type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls in the previous sections can also be used for variables of type AppleEvent. The next six calls are in fact identical to the six calls for AERecord. ************************************************************************* } {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE } FUNCTION AEPutParamPtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0A0F, $A816; {$ENDC} FUNCTION AEPutParamDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; {CONST}VAR theAEDesc: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0610, $A816; {$ENDC} FUNCTION AEGetParamPtr({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0E11, $A816; {$ENDC} FUNCTION AEGetParamDesc({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0812, $A816; {$ENDC} FUNCTION AESizeOfParam({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0829, $A816; {$ENDC} FUNCTION AEDeleteParam(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0413, $A816; {$ENDC} {$ENDC} { ************************************************************************* The following calls also apply to type AppleEvent. Message attributes are far more restricted, and can only be accessed through the following 5 calls. The various list and record routines cannot be used to access the attributes of an event. ************************************************************************* } {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE } FUNCTION AEGetAttributePtr({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR typeCode: DescType; dataPtr: UNIV Ptr; maximumSize: Size; VAR actualSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0E15, $A816; {$ENDC} FUNCTION AEGetAttributeDesc({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; desiredType: DescType; VAR result: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0826, $A816; {$ENDC} FUNCTION AESizeOfAttribute({CONST}VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; VAR typeCode: DescType; VAR dataSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0828, $A816; {$ENDC} FUNCTION AEPutAttributePtr(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; typeCode: DescType; dataPtr: UNIV Ptr; dataSize: Size): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0A16, $A816; {$ENDC} FUNCTION AEPutAttributeDesc(VAR theAppleEvent: AppleEvent; theAEKeyword: AEKeyword; {CONST}VAR theAEDesc: AEDesc): OSErr; {$IFC NOT GENERATINGCFM} INLINE $303C, $0627, $A816; {$ENDC} {$ENDC} {$IFC FOR_SYSTEM8_PREEMPTIVE } {$IFC FOR_PTR_BASED_AE } { ************************************************************************* These calls are used to convert AEDescs into a "flattened", canonical form and back again. ************************************************************************* } FUNCTION AEConvertDescToAEDF({CONST}VAR descriptor: AEDesc; dataBuffer: UNIV Ptr; maximumSize: ByteCount; VAR actualSize: ByteCount): OSStatus; C; FUNCTION AEConvertAEDFToDesc(dataBuffer: UNIV Ptr; bufferSize: ByteCount; VAR result: AEDesc): OSStatus; C; FUNCTION AEConvertAEDFToAppleEvent(eventClass: AEEventClass; eventID: AEEventID; {CONST}VAR target: AEAddressDesc; returnID: AEReturnID; transactionID: AETransactionID; dataBuffer: UNIV Ptr; bufferSize: ByteCount; allocator: MemAllocatorRef; VAR result: AppleEvent): OSStatus; C; { ************************************************************************* The following calls apply to AEStreams. Once a AEStream has been fully written, it may be converted to an AEDesc, AEDescList or AERecord to be used by the various other routines listed above. ************************************************************************* } TYPE AEStream = ^LONGINT; FUNCTION AECreateStream(allocator: MemAllocatorRef; VAR newStream: AEStream): OSStatus; C; FUNCTION AECreateStreamToAppendDescList({CONST}VAR source: AEDescList; allocator: MemAllocatorRef; VAR newStream: AEStream): OSStatus; C; FUNCTION AEDisposeStream(deadStream: AEStream): OSStatus; C; FUNCTION AEWriteStreamKey(stream: AEStream; keyword: AEKeyword): OSStatus; C; FUNCTION AEWriteStreamPtr(stream: AEStream; dataPtr: UNIV Ptr; dataSize: ByteCount): OSStatus; C; FUNCTION AEWriteStreamDesc(stream: AEStream; dataType: DescType; dataPtr: UNIV Ptr; dataSize: ByteCount): OSStatus; C; FUNCTION AEWriteStreamAEDesc(stream: AEStream; {CONST}VAR desc: AEDesc): OSStatus; C; FUNCTION AEOpenStreamDesc(stream: AEStream; descriptorType: DescType): OSStatus; C; FUNCTION AEOpenStreamList(stream: AEStream; factorData: UNIV Ptr; factorSize: ByteCount; isRecord: BOOLEAN): OSStatus; C; FUNCTION AECloseStreamDesc(stream: AEStream): OSStatus; C; FUNCTION AEConvertStreamToDesc(stream: AEStream; VAR desc: AEDesc): OSStatus; C; FUNCTION AEConvertStreamToAEDF(stream: AEStream; dataBuffer: UNIV Ptr; maximumSize: ByteCount; VAR actualSize: ByteCount): OSStatus; C; FUNCTION AEConvertStreamToAppleEvent(eventClass: AEEventClass; eventID: AEEventID; {CONST}VAR target: AEAddressDesc; returnID: AEReturnID; transactionID: AETransactionID; stream: AEStream; allocator: MemAllocatorRef; VAR result: AppleEvent): OSStatus; C; { ************************************************************************* The following calls apply to AESubDescs. AESubDescs provide an efficient way to traverse recursive AERecords and AEDescLists. ************************************************************************* } TYPE OpaqueAESubDescPtr = ^OpaqueAESubDesc; OpaqueAESubDesc = RECORD reserved: ARRAY [0..7] OF UInt32; END; AESubDesc = OpaqueAESubDesc; AESubDescPtr = ^AESubDesc; FUNCTION AEConvertDescToSubDesc({CONST}VAR desc: AEDesc; VAR newSubDesc: AESubDesc): OSStatus; C; FUNCTION AEConvertSubDescToDesc({CONST}VAR subDesc: AESubDesc; desiredType: DescType; VAR desc: AEDesc): OSStatus; C; FUNCTION AEConvertAppleEventAttributesToSubDesc({CONST}VAR event: AppleEvent; VAR subDesc: AESubDesc): OSStatus; C; FUNCTION AESubDescIsListOrRecord({CONST}VAR subDesc: AESubDesc): BOOLEAN; C; FUNCTION AEGetSubDescData({CONST}VAR subDesc: AESubDesc; dataPtr: UNIV Ptr; bufferSize: ByteCount; VAR actualSize: ByteCount): OSStatus; C; FUNCTION AESetSubDescData({CONST}VAR subDesc: AESubDesc; dataPtr: UNIV Ptr; sizePtr: ByteCount): OSStatus; C; FUNCTION AEGetSubDescFactorData({CONST}VAR subDesc: AESubDesc; factorData: UNIV Ptr; bufferSize: ByteCount; VAR actualSize: ByteCount): OSStatus; C; FUNCTION AECountSubDescItems({CONST}VAR subDesc: AESubDesc; VAR items: ItemCount): OSStatus; C; FUNCTION AEGetNthSubDesc({CONST}VAR subDesc: AESubDesc; item: ItemCount; VAR keyword: AEKeyword; VAR newSubDesc: AESubDesc): OSStatus; C; FUNCTION AEGetKeySubDesc({CONST}VAR subDesc: AESubDesc; keyword: AEKeyword; VAR newSubDesc: AESubDesc): OSStatus; C; {$ENDC} {$ENDC} {$ALIGN RESET} {$POP} {$SETC UsingIncludes := AEDataModelIncludes} {$ENDC} {__AEDATAMODEL__} {$IFC NOT UsingIncludes} END. {$ENDC}